package com.project.mapper;

import com.github.pagehelper.PageInfo;
import com.project.bean.ClassBean;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface IClassMapper {

    @Insert("INSERT INTO t_classes(c_className,c_startDate,c_classTeacher)VALUES(#{className},#{startDate},#{classTeacher})")
    public void add(ClassBean classBean);

    @Delete("delete from t_classes where pk_classesId=#{id}")
    public void del(int id);

    @Update("update t_classes set c_classTeacher=#{classTeacher} where pk_classesId=#{id}")
    public void update(@Param("id") int id,@Param("classTeacher") String classTeacher);

    @Select("select * from t_classes  where pk_classesId=#{id}")
    @ResultMap("classMap")
    public ClassBean findById(int id);

    @Select("select * from t_classes")
    @ResultMap("classMap")
    public List<ClassBean> findAll();
}
